package com.ruoyi.project.hidden.hiddenRepair.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.hidden.hiddenRepair.mapper.HiddenRepairMapper;
import com.ruoyi.project.hidden.hiddenRepair.domain.HiddenRepair;
import com.ruoyi.project.hidden.hiddenRepair.service.IHiddenRepairService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 隐患处理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-01-26
 */
@Service
public class HiddenRepairServiceImpl implements IHiddenRepairService 
{
    @Autowired
    private HiddenRepairMapper hiddenRepairMapper;

    /**
     * 查询隐患处理
     * 
     * @param repairId 隐患处理ID
     * @return 隐患处理
     */
    @Override
    public HiddenRepair selectHiddenRepairById(Long repairId)
    {
        return hiddenRepairMapper.selectHiddenRepairById(repairId);
    }

    /**
     * 查询隐患处理列表
     * 
     * @param hiddenRepair 隐患处理
     * @return 隐患处理
     */
    @Override
    public List<HiddenRepair> selectHiddenRepairList(HiddenRepair hiddenRepair)
    {
        return hiddenRepairMapper.selectHiddenRepairList(hiddenRepair);
    }

    /**
     * 新增隐患处理
     * 
     * @param hiddenRepair 隐患处理
     * @return 结果
     */
    @Override
    public int insertHiddenRepair(HiddenRepair hiddenRepair)
    {
        hiddenRepair.setCreateTime(DateUtils.getNowDate());
        return hiddenRepairMapper.insertHiddenRepair(hiddenRepair);
    }

    /**
     * 修改隐患处理
     * 
     * @param hiddenRepair 隐患处理
     * @return 结果
     */
    @Override
    public int updateHiddenRepair(HiddenRepair hiddenRepair)
    {
        return hiddenRepairMapper.updateHiddenRepair(hiddenRepair);
    }

    /**
     * 删除隐患处理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteHiddenRepairByIds(String ids)
    {
        return hiddenRepairMapper.deleteHiddenRepairByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除隐患处理信息
     * 
     * @param repairId 隐患处理ID
     * @return 结果
     */
    @Override
    public int deleteHiddenRepairById(Long repairId)
    {
        return hiddenRepairMapper.deleteHiddenRepairById(repairId);
    }

    @Override
    public Integer queryUnHandleNum(Long processor) {
        return hiddenRepairMapper.queryUnHandleNum(processor);
    }

    @Override
    public Integer queryUnCheckNum(Long checker) {
        return hiddenRepairMapper.queryUnCheckNum(checker);
    }

    @Override
    public HiddenRepair queryRepairByOrderId(Long orderId) {
        return hiddenRepairMapper.queryRepairByOrderId(orderId);
    }

    @Override
    public List<HiddenRepair> queryUnHandleList(Long processor) {
        return hiddenRepairMapper.queryUnHandleList(processor);
    }
}
